<!DOCTYPE html>
<script src="../include.js"></script>
<div contenteditable="true">foobar</div>
<script>
    test(() => {
        const range = document.createRange();
        getSelection().addRange(range);

        const divElm = document.querySelector('div');

        // Set fontName for 'bar'
        range.setStart(divElm.childNodes[0], 3);
        range.setEnd(divElm.childNodes[0], 6);
        document.execCommand('fontName', false, 'monospace');
        println(divElm.innerHTML);

        // Set fontName for the entire editable div
        range.setStart(divElm, 0);
        range.setEnd(divElm, 2);
        document.execCommand('fontName', false, 'sans-serif');
        println(divElm.innerHTML);
    });
</script>
